//******************************************************************************
// @File: cyzEventAction.hh
// @Author: Cyz
// @Date: 2020年 5月 4日 星期一 16时41分00秒 CST
// @Description: 
//		Definition of the cyzEventAction class
//******************************************************************************

#ifndef cyzEventAction_h
#define cyzEventAction_h 1

#include "G4UserEventAction.hh"
#include "G4ThreeVector.hh"
#include "globals.hh"

class cyzRunAction;

/// Event action class
///

class cyzEventAction : public G4UserEventAction
{
  public:
    cyzEventAction();
    virtual ~cyzEventAction();

    virtual void BeginOfEventAction(const G4Event* event);
    virtual void EndOfEventAction(const G4Event* event);

    void AddfEdep_H(G4double fedep) { fEdep_H += fedep; }
		void AddfEdep_B(G4double fedep) { fEdep_B += fedep; }
		void AddfEcenter_H(G4ThreeVector fEdepTimesPosition) { fEcenter_H += fEdepTimesPosition; }
		void AddfEcenter_B(G4ThreeVector fEdepTimesPosition) { fEcenter_B += fEdepTimesPosition; }
		void SetDirection(G4ThreeVector d) { fInitDirection = d; ifInitDirection = false;}
		G4bool GetifInitDirection() { return ifInitDirection; };
	private:
    G4int fEventID; 
		G4ThreeVector fInitDirection;  // Initial Direction of momentum
		G4double fEdep_H;       // Energy deposition on HumanHead
		G4double fEdep_B;       // Energy deposition on HumanBody
		G4ThreeVector fEcenter_H;    // Center of Gravity of Energy deposition on HumanHead
		G4ThreeVector fEcenter_B;    // Center of Gravity of Energy deposition on HumanBody
		G4bool ifInitDirection = true; 
		// Swich: 
		// if fInitDirection haven't valued: true
		// After valued in first Step: false
};

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

#endif

    
